docs: expand RAM/flash optimization guide, rewrite as rule-first reference - #11827
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Code Review by Qodo
1.
|
PR Summary by QodoIntegrate multi-protocol I/O, output assignment, and platform updates
AI Description
Diagram
High-Level Assessment
Files changed (144)
|
…ht#11827 # Conflicts: # docs/development/ram-and-flash-optimization.md
Rebuild of PR iNavFlight#11827's content change on a clean branch based off release/9.1, preserving exactly the branch's file delta (+45/-2): - Correct the WS2812 DMA buffer figures: the element type is timerDMASafeType_t (uint32_t) on every F4/F7/H7/AT32 family since 2019, so the full 3,115-element buffer is 12,460 B and the 2x4-LED circular design is 768 B, not the previously stated 6,230 B / 384 B. The >16x reduction ratio is unchanged. - Add three generalizable RAM techniques from the PR iNavFlight#11785 (terrain AGL hold) review: budget speculative cache reads against the shared cache's size (lookahead capped at (CACHE_SIZE - 3) * 540 m plus a time horizon); consume an existing cache in place, never a private copy; keep a feature's whole static state in one caller-owned struct (the entire hold state machine is ~100 B of static RAM).
d35955b to
7ab25a4
Compare
Clarified example regarding buffer size requirements for MSP handlers.
Summary
Update
docs/development/ram-and-flash-optimization.md(which alreadyexists on
release/9.1via PR #11828) with the two remaining contentchanges from the guide's development branch: corrected WS2812 DMA buffer
figures and three RAM techniques learned from the PR #11785 (terrain AGL
hold) review.
Changes
is
timerDMASafeType_t(uint32_t) on every F4/F7/H7/AT32 family since2019, so the full 3,115-element buffer is 12,460 B and the 2x4-LED
circular design is 768 B, not the previously stated 6,230 B / 384 B. The
size lookahead distance against the cache's capacity, not what the
feature would like to know (terrain lookahead capped at
(TERRAIN_GRID_BLOCK_CACHE_SIZE - 3) * 540 mplus a time horizon).read through the existing cache and mark misses for loading instead of
allocating a shadow buffer (
terrainNavGetHeightAtLocation()holdszero tile buffers of its own).
one visible
sizeof(), pure unit-testable core logic, reset via asingle function (
terrainNavHoldState_t, ~100 B total static RAM).Branch note
Clean single-commit branch based directly on
release/9.1— no mergecommits, no
maintenance-10.xhistory. The same guide's full rewritelives on
maintenance-10.xseparately; this PR carries only the deltaabove onto the 9.1 release branch.
Testing
Related
release/9.1.document-ram-flash-optimization-practiceswill linkthis guide from
Development.mdand extend review checklists.